#ifndef GRAPHTOPOLOGICALSORT_H
#define GRAPHTOPOLOGICALSORT_H

#include <QStack>

#include "igraph.h"
#include "graph.h"
#include "depthfirstsearch.h"

namespace sk {

class GraphTopologicalSort : public DepthFirstSearch {
public:
    GraphTopologicalSort(CGraph* graph, int vertex) : DepthFirstSearch(graph, vertex) {
        this->go();
    }

    void postProcessVertex(int vertex) {
        stack << vertex;
    }

    QStack<int>& getStack() {
        return stack;
    }

private:
    QStack<int> stack;
};

}

#endif // GRAPHTOPOLOGICALSORT_H
